﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Security;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace AssetStudioGUI
{
    public partial class CopyPathIDForm : Form
    {
        public string lastSelectedPath = "";

        public CopyPathIDForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                this.textBox1.Text = openFileDialog1.FileName;
                
            }
        }

        private void button4_Click(object sender, EventArgs e)
        {
            folderBrowserDialog1.SelectedPath = lastSelectedPath;
            if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
            {
                this.textBox3.Text = folderBrowserDialog1.SelectedPath;

                lastSelectedPath = folderBrowserDialog1.SelectedPath;
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                this.textBox2.Text = openFileDialog1.FileName;

            }
        }

        private void button3_Click(object sender, EventArgs e)
        {
            string sourceFile = this.textBox1.Text;
            string targetFile = this.textBox2.Text;
            string outDir = this.textBox3.Text;

            Studio.CopyPathID(sourceFile, targetFile, outDir);
        }
    }
}
